<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
    String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>商户信息列表</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href=<s:url value="/css/common.css"/>>
<script type="text/javascript" src="<s:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<s:url value="/js/jquery.validate.min.js" />"></script>
<script type='text/javascript' src='<s:url value="/js/YLlightbox.js"/>'></script>
<script type="text/javascript"  >

	$(document).ready(function() {
			
			$("#editMer").click(
						function() {
							var dd = $("input[name=multi_sel]:checked");
							if(dd.length != 1){
								alert("只能选择一个商户进行设置！");
								return false;
							}
							var type=$("#merinfoChangeTyep").find('option:selected').val();
							var accountNo = dd.val();
	
							if(dd.length == 0){
								alert("请选择商户");
								return false;
							}else{
							    $("#queryUserForm").attr("action","<%=basePath%>/merinfoChange/applyChange.ct?merinfo.id="+ accountNo);
								$("#queryUserForm").submit();
								return false;
							}

						});
// 				 	$("#query").click(function() {
// 					    var type=$("#merinfoChangeTyep").find('option:selected').text();
// // 					    $("#editMer").val(type);
// 					});	
				 
			});
	function isDetail(str){
		$("#queryUserForm").attr("action","<%=basePath%>/formalMerinfo/queryMerchtDetail.ct?merinfo.id="+str);
		$("#queryUserForm").submit();
	}
</script>
</head>
<body>
	<s:form id="queryUserForm" action="/merinfoChange/queryMerinfo.ct"  method="post" theme="simple"  enctype="multipart/form-data">
		<input type="hidden" id="opid" value="${request.opid}" />
		<table class="tb">
	        <tr class="tb-line">
	            <td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
	        </tr>
		 	<tr class="tb-line">
	            <td class="tb-td" colspan="6"><div class="tb-h3">商户信息列表</div></td>
	        </tr>
			<tr class="tb-line">
				<s:if test="#session.session_merchant.roleType==\"03\"||#session.session_merchant.roleType==\"15\" || #session.session_merchant.roleType==\"16\"">
            		<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                		<div class="tb-h4">商户号：</div>
           			</td>
           			<td class="tb-td">
                		<label class="tb-input-normal">
                			<s:textfield name="searchCondition.merchantNo" cssClass="queryWidth" />
                		</label>
            		</td>
					<td align="right" width="15%"></td>
					<td>
						<s:hidden name="searchCondition.orgCode" value="%{#session.session_merchant.orgCode}" />
					</td>
				</s:if>
				<s:else>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                		<div class="tb-h4">所属机构：</div>
           			</td>
					<td class="tb-td">
                		<label class="tb-select">
							<s:if test="#session.session_merchant.roleType==\"00\"||#session.session_merchant.roleType==\"01\"">
								<s:select cssClass="queryWidth" name="searchCondition.orgCode"
									list="#request.orgList" listKey="InsIdCd" listValue="InsName"
									headerKey="99" headerValue="--请选择--" />
							</s:if> <s:else>
								<s:select cssClass="queryWidth" name="searchCondition.orgCode"
									list="#request.orgList" listKey="InsIdCd" listValue="InsName" />
	
							</s:else>
					     </label>
            		</td>
            		<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                		<div class="tb-h4">商户号：</div>
           			</td>
           			<td class="tb-td">
                		<label class="tb-input-normal">
                			<s:textfield name="searchCondition.merchantNo" cssClass="queryWidth" />
                		</label>
            		</td>
				</s:else>
			</tr>
			<tr class="tb-line">
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
               		<div class="tb-h4">商户名称：</div>
          		</td>
				<td class="tb-td">
                	<label class="tb-input-normal">
						<s:textfield id="accountNo" name="searchCondition.merchantName" cssClass="queryWidth" />
					</label>
            	</td>
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
               		<div class="tb-h4">营业名称：</div>
          		</td>
				<td class="tb-td">
                	<label class="tb-input-normal">
						<s:textfield id="realName" name="searchCondition.merName" cssClass="queryWidth" />
					</label>
            	</td>
			</tr>
			<tr class="tb-line">
				<td width="12%" style="min-width: 150px" align="right" class="tb-td">
               		<div class="tb-h4">所属地区：</div>
          		</td>
				<td class="tb-td">
                	<label class="tb-select">
						<s:select cssClass="queryWidth"
							name="searchCondition.areaCode" list="#request.areaList"
							listKey="key" listValue="value" headerKey="99"
							headerValue="--请选择--" />
				     </label>
            	</td>
            	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
               		<div class="tb-h4">证件号：</div>
          		</td>
				<td class="tb-td">
                	<label class="tb-input-normal">
						<s:textfield id="cardNo" name="searchCondition.cardNo" cssClass="queryWidth" />
					</label>
            	</td>
			</tr>
			<tr class="tb-line">
            	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
               		<div class="tb-h4">商户注册地址：</div>
          		</td>
				<td class="tb-td">
                	<label class="tb-input-normal">
						<s:textfield name="searchCondition.addr"
							cssClass="queryWidth" />
					</label>
				</td>
			</tr>
			<tr class="tb-line">
            	<td class="tb-td line-submit" align="right" colspan="4">
            		<label class="tb-input-submit">
						<s:submit id="query" value="查 询" />
					</label>
					<label class="tb-input-submit">
				    	<s:reset value="取 消" />
				    </label>
				    <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
            			<label class="tb-input-submit">
							<s:submit id="editMer" value="商户信息变更" />
						</label>
					</s:if>
					<s:else>
            			<label class="tb-input-submit">
							<s:submit id="editMer" disabled="true" value="商户信息变更" />
						</label>
				    </s:else>
				</td>
			</tr>
		    <tr class="tb-line" >
				<td class="tb-td" colspan="6" align="center">
					<div style="color: red;">
						<s:actionmessage />
					</div>
					<div style="color: red;">
						<s:actionerror />
					</div>
				</td>
		   </tr>
		</table>
	</s:form>
	<div class="big-tb">
		<table class="tb" style="width: 180%;">
			<thead>
	        	<tr class="tb-line">
                	<th class="tb-th" colspan="20">商户基本信息列表</th>
            	</tr>
          		<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
				<tr class="tb-line">
					<td class="tb-td paging" align="left" colspan="20">
						<page:pageCount
							max_pages="11" totalPage="${requestScope.totalPage}"
							currentPage="${requestScope.currentPage}"
							action="${rootPath}/merinfoChange/queryMerinfo.ct?currentPage=" />
					</td>
				</tr>
				</s:if>
				<tr class="tb-line bg-gray">
					<th class="tb-th">选择</th>
					<th class="tb-th">商户号</th>
					<th class="tb-th">商户简称</th>
					<th class="tb-th">营业名称</th>
					<th class="tb-th">所属机构</th>
					<th class="tb-th">所属代理商</th>
					<th class="tb-th">商户状态</th>
					<th class="tb-th">业务联系人</th>
					<th class="tb-th">业务联系人电话</th>
					<th class="tb-th">法人</th>
					<th class="tb-th">法人证件号</th>
					<th class="tb-th">结算方式</th>
					<th class="tb-th">营业执照</th>
					<th class="tb-th">证件号码</th>
					<th class="tb-th">结算银行</th>
					<th class="tb-th">联行号</th>
					<th class="tb-th">结算银行账号名称</th>
					<th class="tb-th">结算银行账号</th>
					<th class="tb-th">所属地区</th>
					<th class="tb-th">商户地址</th>
				</tr>
			</thead>
			<tbody>
				<s:iterator value="#request.searchRsList" status="stat" id="sh">
					<tr class="tb-line">
					
					<input type="hidden" name="aa" id="opr_<s:property value="#sh.mid"/>"  value="<s:property value="#sh.recUpdOpr"/>"/>
						<%-- <tr class="<s:if test="#stat.index%2==0">tr_0</s:if>"> --%>
						<td class="tb-td" align="center">
						<%-- 
						          <s:if test="#session.session_merchant.id==#sh.recUpdOpr">
						           --%>
						          
								  <s:checkboxlist  name="multi_sel" list="#{#sh.mid:''}"  theme="simple" />
							    <%-- </s:if>
							    <s:else>
							     <s:checkboxlist disabled="true" name="multi_sel" list="#{#sh.mid:''}"  theme="simple" />
								  </s:else> --%>
								  
								  
						<%-- 	<s:checkboxlist name="multi_sel"  list="#{#sh.mid:''}" theme="simple" /> --%>
							
						</td>
						<td class="tb-td">
							<a href="javascript:isDetail(<s:property value="#sh.mid"/>)"><s:property value="#sh.mid"/></a>
						</td>
						<td width="200px;">
							<s:property value="#sh.merName" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.merBrName" />
						</td>	
						<td class="tb-td">
							<s:property value="#sh.merKind" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.agentId" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.flag" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.perName" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.perPhone" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.interContact" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.cardNo" />
						</td>
						<td class="tb-td">
				    <%--     	<s:iterator value="#sh.merCycle" var="c" status="st">
				        		<s:property value="#c"/>
				        			<s:if test="#sh.merCycle.size()>1 && #st.index==0">+</s:if>
				        	</s:iterator> --%>
				        	<s:property value="#sh.cycleId" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.flagCode" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.cardNo" />
						</td>
						
						<td class="tb-td">
							<s:property value="#sh.amount1" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.amount2" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.rsvl" />
						</td>
						<td class="tb-td">
							<s:property value="#sh.rsvl3" />
						</td>
						<td class="tb-td">
							<s:iterator value="#request.areaList" id="area">
								<s:if test="#area.key == #sh.areaCode">
									<s:property value="#area.value" />
								</s:if>
							</s:iterator>
						</td>
						<td class="tb-td">
							<s:property value="#sh.addr" />
						</td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	</div>
	<s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>
</body>
</html>
